home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************
- * "Epsilon", "EEL" and "Lugaru" are trademarks of Lugaru Software, Ltd. *
- * *
- * Copyright (C) 1985 Lugaru Software Ltd. All rights reserved. *
- * *
- * Limited permission is hereby granted to reproduce and modify this *
- * copyrighted material provided that the resulting code is used only in *
- * conjunction with Lugaru products and that this notice is retained in *
- * any such reproduction or modification. *
- ************************************************************************/
-
- /*
- * Modifications copyright (c) 1985 by David Dyer-Bennet
- * Permission for non-commercial use is hereby granted; all other
- * rights are reserved.
- *
- * Modifications by David Dyer-Bennet
- * Terrabit Software
- * 4242 Minnehaha Ave S
- * Minneapolis, MN 55406
- * Sysop of Fido 14/341, The Terraboard, (612) 721-8967 3/12/24 24hrs
- * (612) 721-8800 NOT 24 hrs! More like noon to midnight
- */
-
- /*
- * Revision history:
- *
- * Edit Date Who Description
- *
- * Version 1.0
- * 0 12-Nov-85 Lugaru Epsilon Version 3.01
- * 1 3-Jan-86 DD-B Make error recognizer flexible
- */
-
- #include "eel.h"
-
- buffer char *error_recog; /* [1] How to recognize a compiler error */
- buffer char *erfile_recog; /* [1] How to recognize the file */
- /* group 1 must be file name */
- buffer char *erline_recog; /* [1] How to recognize the line no. */
- /* group 1 must be line number */
-
- /* Process commands. */
-
- char push_cmd[80];
-
- no_running() /* make sure no process is running */
- {
- if (!another)
- return 0;
- say("A process is already running.");
- to_buffer("process");
- point = size();
- return 1;
- }
-
- command push() on cx_tab[CTRL('E')]
- {
- int error;
- char cmd[80], cmdline[90];
-
- if (no_running())
- return;
- cmdline[0] = 0;
- if (has_arg) {
- get_string(cmd, "Push With Command: ");
- if (*cmd)
- strcpy(push_cmd, cmd);
- if (*push_cmd)
- sprintf(cmdline, "/c %s", push_cmd);
- }
- iter = 0;
- build_first = 1;
- term_position(0, 23);
- error = shell(getenv("COMSPEC"), cmdline);
- if (cmdline[0]) {
- if (!char_avail())
- sayput("Press any key to return to Epsilon");
- getkey();
- }
- say(error ? "Couldn't exec": "");
- }
-
- command start_process() on cx_tab[CTRL('M')]
- {
- int error = 0;
- char cmd[80], cmdline[90];
-
- if (no_running())
- return;
- cmdline[0] = 0;
- if (has_arg) {
- get_string(cmd, "Start Process With Command: ");
- if (*cmd)
- strcpy(push_cmd, cmd);
- if (*push_cmd)
- sprintf(cmdline, "/c %s", push_cmd);
- }
- zap("process");
-
- error = concur_shell(getenv("COMSPEC"), cmdline);
- iter = 0;
- if (error)
- say("Couldn't exec");
- else
- to_buffer("process");
- }
-
- command stop_process() on reg_tab[CTRL('C')]
- {
- halt_process(has_arg);
- iter = 0;
- }
-
- command next_error() on cx_tab[CTRL('N')]
- /* [1]
- * Find the next error message in the process buffer. The format of
- * the error is deduced from buffer-specific variables; this routine
- * should be called from a buffer of the right language!
- */
- {
- char *orig = bufname, file[FNAMELEN], number[30], line[130];
- int lineno, origpt, dir, orig_num = window_number, old;
- char *er=error_recog, *ef=erfile_recog, *el=erline_recog;
- /* [1] Local copies */
-
- if (!exist("process"))
- error("No process buffer to read errors from.");
- bufname = "process";
- error_recog = er; /* /[1] Copy to process buffer */
- erfile_recog = ef;
- erline_recog = el;
- origpt = point;
- if (error_spot)
- point = *error_spot;
- else {
- error_spot = alloc_spot();
- point = 0;
- }
- sayput("Searching...");
- for (; iter; iter -= dir) {
- dir = (iter > 0) ? 1 : -1;
- old = point;
- if (!re_search(dir, er)) {
- *error_spot = old;
- point = origpt;
- bufname = orig;
- say("No more errors");
- iter = 0;
- return;
- }
- }
- to_begin_line(); /* [1] */
- re_search(1, ef); /* [1] Find file name */
- grab (find_group (1, 1), find_group (1, 0), file);
- /* [1] Abstract the name */
- re_search(1, el); /* [1] Find line number */
- grab (find_group (1, 1), find_group (1, 0), number);
- /* [1] Abstract the line number */
- to_begin_line(); /* [1] Now pick up whole line */
- parse_string (1, ".*", line);
- *error_spot = point;
- point = origpt;
- lineno = strtoi(number, 10);
- absolute(file);
-
- bufname = orig;
- window_number = 0;
- do {
- if (!strcmp(filename, file))
- orig_num = window_number;
- window_number++;
- } while (window_number);
- window_number = orig_num;
- find_it(file);
- go_line(lineno);
- say("=>%.78s", line);
- }
-